function start_graph_construction(plotResults)
    tStart = tic;
   
    defines = evalin('base','defines');
    sourceMetabolite = defines.initialCompound;
    maxPathConstructionLevels = defines.lengthOfBuildPathways;
    
    disp('Starting .. ');
    
    metabolites = {{sourceMetabolite}};
    graphNodes = [{sourceMetabolite}, 1];
    graphEdges = [];
    statisticsDataLabels = ['Level ','   Nodes ', '   Edges ', '     Time '];
    statisticsData = [];
     
    tStartLevel = tic;
    h = waitbar(0,'Please wait... Creating graph');
    for i = 1:str2num(maxPathConstructionLevels)
        waitbar(i/str2num(maxPathConstructionLevels),h, [num2str(i), ' level of ', ... 
            maxPathConstructionLevels, ' total' ])
        drawnow update
        
        disp(['construction level: ' num2str(i)]);
        [metabolites,graphNodes,graphEdges] = ...
            create_graph_level(metabolites,graphNodes,graphEdges);
        tElapsedForLevel = toc(tStartLevel);
       
        compounds = evalin('base', 'compounds');
        reactions = evalin('base', 'reactions');
        statisticsData = [statisticsData; i, length(graphNodes), length(graphEdges),tElapsedForLevel];
        
        disp('############################################');
    end
    close(h)
    disp(statisticsDataLabels);
    disp(statisticsData);
    
    if strcmp(plotResults,'true')
        plot_graph_construction_results(statisticsData);
    end
    
    tElapsedCOnstruction = toc(tStart)
    
    disp('Building sMatrix ..');
    
    graphEdges = unique(cell2mat(graphEdges),'rows');
    assignin('base','graphNodes',graphNodes);
    assignin('base','graphEdges',graphEdges);
    
    if ~size(graphEdges) == [0,0]
       sMatrix = construct_sparse_graph(graphNodes, graphEdges);
    else
        sMatrix = [];
    end
    
    assignin('base', 'tElapsedCOnstruction', tElapsedCOnstruction);

    assignin('base', 'sMatrix', sMatrix);
    assignin('base', 'statisticsData', statisticsData);
  
    clear graphNodes;
    clear graphEdges;
    clear sMatrix;   
    clear statisticsData;
    clear compounds;
    clear reactions;
    clear defines;
end
